﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>退货界面</title>
    <!--<link type="text/css" rel="stylesheet" href="../static/css/Return.css"/>-->
<link type="text/css" rel="stylesheet" href="/css/Return.css"/>
</head>
<body>
<div class="returnTop">

    <div class="return_box">
        <!--查询订单的数据-->
        <form id="inputReturnFrom" method="post">
            <div class="inputs">
                <input type="button" value="查询">
                <input type="text" placeholder="请输入订单号" name="orderId" th:value="${orderId}" class="order_no" onkeyup="return ValidateNumber($(this),value)">
            </div>
        </form>
        <div class="top">
                    <!--cellpadding表示每个单元格之间的内间距为0，-->
                    <table class="providerTable" cellpadding="0" cellspacing="0">
                        <tr class="firstTr">
                            <th width="15%">编号<span></span></th>
                            <th width="22%" class="names">商家名称<span></span></th>
                            <th width="10%">商品编号<span></span></th>
                            <th width="12%">商品名称<span></span></th>
                            <th width="15%">价格</th>
                            <th width="15%">商品数量</th>
                            <th width="15%">商品描述<span></span></th>

                        </tr>

                        <tr th:each="t, line : ${lookReturn}" class="input_sk">
                            <th><span th:text="${line.count}"></span></th>
                            <th><span th:text="${t.provider.name}"></span></th>
                            <th><span th:text="${t.id }"></span></th>
                            <th><span th:text="${t.name }"></span></th>
                            <th><span th:text="${t.price }"></span></th>
                            <th><span th:text="${t.amonut }"></span></th>
                            <th><span th:text="${t.describes }"></span></th>
                        </tr>
                        <!--<tr hidden="${lookReturn == null ? 'hidden' : '' }">-->
                        <!--<td>-->
                        <!--<span th:text="${lookReturn == null ? '无此订单' : '' }"></span>-->
                        <!--</td>-->
                        <!--</tr>-->
                    </table>
                    <!--退货提交申请的数据-->
                    <div class="bottom-toolbar">
                        <div class="bottom-toolbar2">
                            <form id="orderIdFrom" method="post">
                                <div hidden class="order_note">
                                    订单单号: <input  onkeyup="return ValidateNumber($(this),value)" class="inpunt-top" name="orderId">
                                </div>
                                <div hidden class="order_note">
                                    商品号码: <input name="commodityId" onkeyup="return ValidateNumber($(this),value)"class="orderId">
                                </div>
                                <div hidden class="order_note">
                                    退货数量:&nbsp;<input name="commodityCount" type="text" onkeyup="return ValidateNumber($(this),value)">
                                </div>
                                <div hidden class="order_note">
                                    总计金额:&nbsp;<input name="totalPrice" type="text">
                                </div>
                                <!--<div hidden class="order_note">-->
                                    <!--退款时间:&nbsp;<input name="password" type="password">-->
                                <!--</div>-->
                                <div hidden class="order_note">
                                    <span hidden class="order_note">退款原因:&nbsp;</span>
                                        <select name="refundReason" hidden class="order_note">
                                        <option value="">请选择</option>
                                        <option value="不好意思,不想要了">不好意思,不想要了</option>
                                        <option value="一时没想好，不想要了">一时没想好，不想要了</option>
                                        <option value="拍错了，不好意思">拍错了，不好意思</option>
                                        <option value="暂时不想要了" >暂时不想要了</option>
                                    </select>
                                </div>
                                </form>
                            <a href="javascript:void(0)" name="test" id="test" hidden class="order_note">提交</a>
                        </div>
                            </div>
                    </div>
            </div>
    </div>

</body>
<script src="/js/jquery-2.2.1.min.js"></script>
<script src="/js/jump.js"></script>
<script type="text/javascript" th:inline="javascript">

    //提交数据
    $("#test").bind("click",function () {
        if(!confirm("确定提交吗?")) return;
        // toJump("/lookCommodity/singleWhole",$("#orderIdFrom").serialize());
        location="/lookCommodity/singleWhole?"+$("#orderIdFrom").serialize();
    })



//测试，点击事件，
    $(".inputs :button[value='查询']").bind("click",function () {
        // toJump("/lookCommodity/lookReturn",$("#inputReturnFrom").serialize())

        location = "/lookCommodity/lookReturn?"+$("#inputReturnFrom").serialize();
        // $.post("/lookCommodity/lookReturn",$("#inputReturnFrom").serialize(), function(data) {
        //
        // });


    })

var lookReturn = [[${lookReturn}]];

if (lookReturn != null){
    $(".order_note").removeAttr("hidden");

//    把查询到的订单，保存到订单框里面
    var tt = $(".order_no").val();
    $(".inpunt-top").val(tt);
    $(".inpunt-top").attr("readonly","readonly");

}

//绑定事件，计算金额
//     $(document).bind('input propertychange',"#housing-chengjiao-price,#down-payments",function(){
//         var cjprice = $("#housing-chengjiao-price").val();
//         var shoufu=$('#down-payments').val();
//         var dkprice=cjprice-shoufu;//计算贷款
//         $('#loan').html(dkprice);
//     });




// <!--监听事件，当其中的内容发生变化的时候，就执行某些操作-->
// $("#orderId").on("DOMNodeInserted",function () {
//     alert("123")
//     var text = $(".orderId").text();
//     alert(text);
//     alert("你好呀");
// })

// $("input[type='orderId']").bind('input propertychange',function(){
//     alert("123")
// })






//限制只能输入数字
function ValidateNumber(e, pnumber) {
    if (!/^\d+$/.test(pnumber)) {

        $(e).val(/^\d+/.exec($(e).val()));

    }
    return false;
}



















</script>
</html>